Invert
Check options and parameters of invert method
The invert filter is an image processing technique used to reverse the color values of an image, creating a negative or "inverted" version of the original. In this process, the darkest areas become the lightest, and the lightest areas become the darkest, while the midtones are adjusted accordingly. The invert filter is a simple but effective way to create visual contrast and produce interesting effects.


Parameters and default values
options
Options
Option | Default value |
---|---|
out | - |
Implementation
Here's how invert filter is implemented in ImageJS:
Pixel Transformation: For each pixel in the image, the inversion filter transforms its color intensity value. The new intensity value is calculated using the formula:
Where "Max Intensity" is the maximum possible intensity value for the color channel.
ImageJS uses components to calculate each pixel value and leaves alpha channel unchanged. For more information about channels and components visit this link.